<template>
    <div class="content">
      <div class="content-first">
        <div class="first-list">
          <h1 class="list-first">发现新视界</h1>
          <p class="list-second">在线上传、分享和发现3D模型</p>
          <button class="list-third" @click="showModal = true">加入我们</button>
        </div>
      </div>
      <teleport to="body">
        <div v-if="showModal" class="modal">
          <div class="modal-content">
            <HomeCome />
            <button class="modal-close" @click="showModal = false">关闭</button>
          </div>
        </div>
      </teleport>
      <div class="content-second">
        <div class="second-list">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-diannao"></use>
            </svg>
            <p class="list-firstone">在线3D展示</p>
            <p>支持模型在PC端/手机端分享展示</p>
        </div>
        <div class="second-list">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-yinqing"></use>
            </svg>
            <p class="list-firstone">在线3D展示</p>
            <p>支持模型在PC端/手机端分享展示</p>
        </div>
        <div class="second-list">
            <svg class="icon" aria-hidden="true">
              <use xlink:href="#icon-a-zujiantianchong_huaban1fuben18"></use>
            </svg>
            <p class="list-firstone">在线3D展示</p>
            <p>支持模型在PC端/手机端分享展示</p>
        </div>
      </div>
      <div class="content-third">
        <div class="third-list">
            <h1>增值你的设计</h1>
            <div class="third-p">
                <p>在手机、PC浏览器中，轻松分享/展示作品</p>
                <p>专有3D个人作品主页</p>
                <p>让作品交付不再困难</p>
            </div>
            
        </div>
        <div class="third-listone">
            <img src="../../assets/index-editor-2.ca2d1227.gif">
        </div>
      </div>
      
    </div>
  </template>
  
  <script setup>
  import HomeCome from "./HomeCome.vue";
  import { ref } from 'vue';
  const showModal = ref(false);
  </script>
  
  <style scoped>
.content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  padding: 0px;
  background-color: rgb(45, 45, 45);
}

.content-first {
  background-image: url(../../assets/home_one.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.first-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.list-first {
  font-size: 3rem;
  color: white;
}

.list-second {
  font-size: 1.5rem;
  color: white;
}

.list-third {
  font-size: 1rem;
  color: white;
  padding: 15px 40px;
  background-color: rgb(60, 160, 217);
  border: none;
}

.content-second {
  background-color: rgb(45, 45, 45);
  height: 300px;
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
}

.second-list {
  text-align: center;
}

.second-list > :nth-child(3) {
  color: white;
}

.second-list .icon {
  width: 50px;
  height: 50px;
  color: white;
}

.list-firstone {
  font-size: 1.2rem;
  color: white;
  font-weight: bolder;
  padding-bottom: 10px;
  padding-top: 30px;
}

.content-third {
  background-color: rgb(45, 45, 45);
  height: 500px;
  width: 100%;
  display: flex;
}

.third-list {
  margin-top: 50px;
  margin-left: 100px;
  margin-right: 50px;
}

.third-list h1 {
  color: white;
  margin-bottom: 60px;
}

.third-list p {
  color: rgb(132, 132, 132);
  padding: 10px 0px;
}

.third-listone {
  margin-top: 50px;
  margin-right: 100px;
}

.third-listone img {
  width: 100%;
  height: 100%;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  width: 300px;
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
  .content-first {
    height: 80%;
  }

  .list-first {
    font-size: 2rem;
  }

  .list-second {
    font-size: 1.2rem;
  }

  .content-second {
    height: auto;
    padding: 30px 0;
  }

  .content-third {
    flex-direction: column;
    align-items: center;
    height: auto;
    padding: 30px 0;
  }

  .third-list,
  .third-listone {
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 20px;
  }
}

@media screen and (max-width: 768px) {
  .content-first {
    height: 70%;
  }

  .list-first {
    font-size: 1.5rem;
  }

  .list-second {
    font-size: 1rem;
  }

  .second-list {
    margin-bottom: 20px;
  }
}

@media screen and (max-width: 480px) {
  .content-first {
    height: 60%;
  }

  .list-first {
    font-size: 1.2rem;
  }

  .list-second {
    font-size: 0.8rem;
  }

  .list-third {
    padding: 10px 30px;
  }
}
</style>